package hn.sigit.dao.hnd.administrative;

import hn.sigit.model.hnd.administrative.HND_BuildingPermit;

import java.io.Serializable;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

public class HND_BuildingPermitDAO extends HND_PermitDAO implements Serializable {
	private static final long serialVersionUID = 1L;

	protected HND_BuildingPermitDAO() {
	}
	
	public static HND_BuildingPermit loadBuildingPermitByID(long permitId) {
		return loadBuildingPermitByID(getSession(), permitId);
	}
	
	public static HND_BuildingPermit loadBuildingPermitByID(Session session, long permitId) {
		Criteria criteria = session.createCriteria(HND_BuildingPermit.class);
		criteria.add(Restrictions.eq("id", permitId));
		
		return (HND_BuildingPermit) criteria.uniqueResult();
	}
}
